@echo off
set COMPILEDIR=%CD%
set color=1e
color %color%

echo  Checking language directories...

if not exist ..\..\zone\english mkdir ..\..\zone\english
if not exist ..\..\zone_source\english xcopy ..\..\zone_source\english ..\..\zone_source\english /SYI > NUL

echo _________________________________________________________________
echo.
echo  Building mp_shift.iwd:
echo    Deleting old mp_shift.iwd file...
del mp_shift.iwd
del mp_shift_configs.iwd
echo    Adding images...
7za a -r -tzip mp_shift.iwd images\*.iwi > NUL
echo    Adding configuration files...
7za a -r -tzip mp_shift_configs.iwd credits.txt > NUL
7za a -r -tzip mp_shift_configs.iwd configs\*.gsc > NUL

echo  New mp_shift.iwd file successfully built!
echo _________________________________________________________________
echo.
echo  Building mod.ff:
echo    Deleting old mod.ff file...
del mod.ff

echo    Copying localized strings...
xcopy english ..\..\raw\english /SYI > NUL

echo    Copying game resources...
xcopy configs ..\..\raw\configs /SYI > NUL
xcopy images ..\..\raw\images /SYI > NUL
xcopy maps ..\..\raw\maps /SYI > NUL
xcopy materials ..\..\raw\materials /SYI > NUL

echo    Copying xmodel resources...
xcopy xmodel ..\..\raw\xmodel /SYI > NUL
xcopy xmodelparts ..\..\raw\xmodelparts /SYI > NUL
xcopy xmodelsurfs ..\..\raw\xmodelsurfs /SYI > NUL

echo    Copying shift custom items...
xcopy mp ..\..\raw\mp /SYI > NUL
xcopy ui_mp ..\..\raw\ui_mp /SYI > NUL
xcopy shift ..\..\raw\shift /SYI > NUL
xcopy myWhitelist.cfg ..\..\raw /SYI > NUL

copy /Y mod.csv ..\..\zone_source > NUL
cd ..\..\bin > NUL

echo    Compiling mod...
linker_pc.exe -language english -compress -cleanup mod 
cd %COMPILEDIR% > NUL
copy ..\..\zone\english\mod.ff > NUL
echo  New shift custom mod.ff file successfully built!
goto END


:END
echo.
RD /S /Q ..\mp_shift
md ..\mp_shift
xcopy mod.ff ..\mp_shift /SYI > NUL
xcopy mp_shift.iwd ..\mp_shift /SYI > NUL
xcopy mp_shift_configs.iwd ..\mp_shift /SYI > NUL

:RUN_GAME
echo _________________________________________________________________
echo.
echo  Please choose option:
echo    1. Start COD BO multiplayer
echo    2. Exit
echo.

choice /C:12 /T 10 /D 2
if errorlevel 2 goto END
if errorlevel 1 goto ONE
goto END

:ONE
start steam://rungameid/42710

:END
